home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
2.2
/
takeuchi.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
929b
|
34 lines
" NAME takeuchi
AUTHOR tph@cs.man.ac.uk
FUNCTION benchmark: triply recursive numerical filter
ST-VERSIONS 2.2
PREREQUISITES
CONFLICTS
DISTRIBUTION world
VERSION 1.1
DATE 22 Jan 1989
SUMMARY takeuchi
provides an implementation of ""Takeuchi's function, a
triply recursive numerical filter"", used as a benchmark for the
REKURSIV machine.(2.2). TPH
"!
'From Smalltalk-80, Version 2.2 of July 4, 1987 on 9 February 1988 at 9:57:12 am'!
!Integer methodsFor: 'mathematical functions'!
takeuchiWith: y and: z
"Takeuchi's function a triply recursive numerical filter. Used as a
benchmark for the RECURSIV machine. self is x."
(y >= self)
ifTrue: [^z]
ifFalse: [
^(((self - 1) takeuchiWith: y and: z) takeuchiWith:
((y - 1) takeuchiWith: z and: self) and:
((z - 1) takeuchiWith: self and: y))]
"18 takeuchiWith: 12 and: 6."
"Time millisecondsToRun: [18 takeuchiWith: 12 and: 6]."! !